<?php 
require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
MYTCONN();

if($_GET['area']==1)  {
} elseif($_GET['area']==2) { ?>
	<?php mn_field('button','ED','sys_Print','','','','','" style="background-image:url(\''.$GLOBALS['GFX'].'CentrodeCustos/invoice.png\');width:52px;height:45px;margin:2px" onclick="printdiv(\'app\');'); ?>
	<?php mn_field('button','ED','sys_Print','','','','','" style="background-image:url(\''.$GLOBALS['GFX'].'CentrodeCustos/note.png\');width:52px;height:45px;margin:2px" onclick="printdiv(\'app\');'); ?>
	<?php mn_field('button','ED','sys_Print','','','','','" style="background-image:url(\''.$GLOBALS['GFX'].'Objects/print.png\');width:52px;height:45px;margin:2px" onclick="printdiv(\'app\');'); 
	mn_field('button','ED','new_Invoice','Nova Factura','','','','" style="width:98%;height:30px;margin:2px" onclick="idwindow(\'Propriedades de Factura\',\'winccfac\',\'\',\'Modules/CentrodeCustos/Lib/addinvoice.php\',980,600);');
	mn_field('button','ED','view_Invoice','Consultar Facturas','','','','" style="width:98%;height:30px;margin:2px" onclick="replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB=111\');');
	mn_field('button','ED','view_Balance','Extracto de Contas','','','','" style="width:98%;height:30px;margin:2px" onclick="replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB=221\');');
	mn_field('button','ED','view_PayOrders','Ordens de Pagamento','','','','" style="width:98%;height:30px;margin:2px" onclick="replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB=211\');');
	mn_field('button','ED','view_Results','Totais por Loja','','','','" style="width:98%;height:30px;margin:2px" onclick="replaceUrl(\'app\',\'Modules/CentrodeCustos/msetresult.php\');');

    $Nav = $GLOBALS['MYT']->db_array("SELECT hnav_areas.ref,
						hnav_areas.name
					FROM systemoffice.hnav_areas
					WHERE hnav_areas.Module = 16
					AND Type = 2
				ORDER BY name"); 
	echo '<table><tr bgcolor="#F2F2F2">
          <td rowspan="'.($Nav[0]+1).'" bgcolor="#CED7DE">
		  <img src="'.$GLOBALS['GFX'].'CentrodeCustos/Econ.png" border="0" alt="Economato"></td>
        </tr>';
	for ($f = 1; $f <= $Nav[0]; $f++) {
       echo '<tr bgcolor="#F8F8F8">
          <td><a href="javascript:replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB='.$Nav[$f]['ref'].'\');">'.$Nav[$f]['name'].'</a></td>
        </tr>';
		} ?>
        <tr bgcolor="#F2F2F2">
          <td height="8" bgcolor="#F2F2F2"></td>
        </tr>
        <tr bgcolor="#F2F2F2">
          <td rowspan="4" bgcolor="#CED7DE">
		  <img src="<?php echo $GLOBALS['GFX'];?>CentrodeCustos/Econ.png" border="0" alt="Economato">
		  </td>
        </tr>
        <?php
    $Nav = $GLOBALS['MYT']->db_array("SELECT hnav_areas.ref,
						hnav_areas.name
					FROM systemoffice.hnav_areas
					WHERE hnav_areas.Module = 16
					AND Type = 3
				ORDER BY name"); 
	for ($f = 1; $f <= $Nav[0]; $f++) {
       echo '<tr bgcolor="#F8F8F8">
          <td><a href="javascript:replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB='.$Nav[$f]['ref'].'\');">'.$Nav[$f]['name'].'</a></td>
        </tr>';
		} ?>
        <tr bgcolor="#F2F2F2">
          <td height="8" colspan="3"></td>
        </tr>
	 <tr bgcolor="#F2F2F2">
          <td width="32" rowspan="3" bgcolor="#CED7DE">
		  <img src="<?php echo $GLOBALS['GFX'];?>CentrodeCustos/Econ.png" border="0" alt="Economato">
		  </td>
        </tr>
        <?php
    $Nav = $GLOBALS['MYT']->db_array("SELECT hnav_areas.ref,
						hnav_areas.name
					FROM systemoffice.hnav_areas
					WHERE hnav_areas.Module = 16
					AND Type = 9
				ORDER BY name"); 
	for ($f = 1; $f <= $Nav[0]; $f++) {
       echo '<tr bgcolor="#F8F8F8">
          <td><a href="javascript:replaceUrl(\'app\',\'Modules/CentrodeCustos/mback.php?jB='.$Nav[$f]['ref'].'\');">'.$Nav[$f]['name'].'</a></td>
        </tr>';
		} ?>
    </table>
 <?php } elseif($_GET['area']==3 || $_GET['area']==4) {
} ?>